﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DbGenerator.Factory.events;
using System.Data.SqlClient;
using DbGenerator.Model.units.database;
using DbGenerator.Factory.concrete;

namespace DbGenerator.Factory.generator
{
    public static class SDbFactory
    {
        #region ctors
        static SDbFactory()
        {
            _Generator = new TDbFactory();
            _ConcreteWriter = new TConcreteWriter();
        }
        #endregion

        #region methods
        public static void GenerateFromScratch(TFactoryArgs gene)
        {
            _Generator.GenerateFromScratch(null, gene);
        }
        public static void ReadFromScratch(TFactoryArgs gene)
        {
            _Generator.ReadDatabaseScratch(null, gene);
        }
        public static void CreateConcrete(TFactoryArgs gene)
        {
            gene.EntityTypes
                .AddRange(
                _ConcreteWriter.WriteConcreteDll(gene));
        }
        #endregion

        #region private fields
        private static TDbFactory _Generator;
        private static TConcreteWriter _ConcreteWriter;
        #endregion
    }
}
